0 CpxTRS
↳1 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxWeightedTrs
↳3 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxTypedWeightedTrs
↳5 CompletionProof (UPPER BOUND(ID), 0 ms)
↳6 CpxTypedWeightedCompleteTrs
↳7 NarrowingProof (BOTH BOUNDS(ID, ID), 0 ms)
↳8 CpxTypedWeightedCompleteTrs
↳9 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳10 CpxRNTS
↳11 SimplificationProof (BOTH BOUNDS(ID, ID), 0 ms)
↳12 CpxRNTS
↳13 CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID), 0 ms)
↳14 CpxRNTS
↳15 IntTrsBoundProof (UPPER BOUND(ID), 2969 ms)
↳16 CpxRNTS
↳17 IntTrsBoundProof (UPPER BOUND(ID), 726 ms)
↳18 CpxRNTS
↳19 ResultPropagationProof (UPPER BOUND(ID), 0 ms)
↳20 CpxRNTS
↳21 IntTrsBoundProof (UPPER BOUND(ID), 461 ms)
↳22 CpxRNTS
↳23 IntTrsBoundProof (UPPER BOUND(ID), 98 ms)
↳24 CpxRNTS
↳25 FinalProof (⇔, 0 ms)
↳26 BOUNDS(1, n^3)
sort(nil) → nil
sort(cons(x, y)) → insert(x, sort(y))
insert(x, nil) → cons(x, nil)
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v)
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w))
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w))
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z)
sort(nil) → nil [1]
sort(cons(x, y)) → insert(x, sort(y)) [1]
insert(x, nil) → cons(x, nil) [1]
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v) [1]
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w)) [1]
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w)) [1]
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z) [1]
sort(nil) → nil [1]
sort(cons(x, y)) → insert(x, sort(y)) [1]
insert(x, nil) → cons(x, nil) [1]
insert(x, cons(v, w)) → choose(x, cons(v, w), x, v) [1]
choose(x, cons(v, w), y, 0) → cons(x, cons(v, w)) [1]
choose(x, cons(v, w), 0, s(z)) → cons(v, insert(x, w)) [1]
choose(x, cons(v, w), s(y), s(z)) → choose(x, cons(v, w), y, z) [1]
sort :: nil:cons → nil:cons nil :: nil:cons cons :: 0:s → nil:cons → nil:cons insert :: 0:s → nil:cons → nil:cons choose :: 0:s → nil:cons → 0:s → 0:s → nil:cons 0 :: 0:s s :: 0:s → 0:s |
(a) The obligation is a constructor system where every type has a constant constructor,
(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:
none
(c) The following functions are completely defined:
sort
insert
choose
choose(v0, v1, v2, v3) → nil [0]
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
nil => 0
0 => 0
choose(z', z'', z1, z2) -{ 1 }→ choose(x, 1 + v + w, y, z) :|: v >= 0, z >= 0, z' = x, z2 = 1 + z, x >= 0, y >= 0, z1 = 1 + y, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 0 }→ 0 :|: z2 = v3, v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, v3 >= 0, z' = v0
choose(z', z'', z1, z2) -{ 1 }→ 1 + v + insert(x, w) :|: z1 = 0, v >= 0, z >= 0, z' = x, z2 = 1 + z, x >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 1 }→ 1 + x + (1 + v + w) :|: z1 = y, v >= 0, z' = x, z2 = 0, x >= 0, y >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ choose(x, 1 + v + w, x, v) :|: v >= 0, z' = x, x >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ 1 + x + 0 :|: z'' = 0, z' = x, x >= 0
sort(z') -{ 2 }→ insert(x, insert(x', sort(y'))) :|: z' = 1 + x + (1 + x' + y'), x >= 0, x' >= 0, y' >= 0
sort(z') -{ 2 }→ insert(x, 0) :|: x >= 0, z' = 1 + x + 0
sort(z') -{ 1 }→ 0 :|: z' = 0
choose(z', z'', z1, z2) -{ 1 }→ choose(z', 1 + v + w, z1 - 1, z2 - 1) :|: v >= 0, z2 - 1 >= 0, z' >= 0, z1 - 1 >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
choose(z', z'', z1, z2) -{ 1 }→ 1 + v + insert(z', w) :|: z1 = 0, v >= 0, z2 - 1 >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 1 }→ 1 + z' + (1 + v + w) :|: v >= 0, z2 = 0, z' >= 0, z1 >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ choose(z', 1 + v + w, z', v) :|: v >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ 1 + z' + 0 :|: z'' = 0, z' >= 0
sort(z') -{ 2 }→ insert(x, insert(x', sort(y'))) :|: z' = 1 + x + (1 + x' + y'), x >= 0, x' >= 0, y' >= 0
sort(z') -{ 2 }→ insert(z' - 1, 0) :|: z' - 1 >= 0
sort(z') -{ 1 }→ 0 :|: z' = 0
{ insert, choose } { sort } |
choose(z', z'', z1, z2) -{ 1 }→ choose(z', 1 + v + w, z1 - 1, z2 - 1) :|: v >= 0, z2 - 1 >= 0, z' >= 0, z1 - 1 >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
choose(z', z'', z1, z2) -{ 1 }→ 1 + v + insert(z', w) :|: z1 = 0, v >= 0, z2 - 1 >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 1 }→ 1 + z' + (1 + v + w) :|: v >= 0, z2 = 0, z' >= 0, z1 >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ choose(z', 1 + v + w, z', v) :|: v >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ 1 + z' + 0 :|: z'' = 0, z' >= 0
sort(z') -{ 2 }→ insert(x, insert(x', sort(y'))) :|: z' = 1 + x + (1 + x' + y'), x >= 0, x' >= 0, y' >= 0
sort(z') -{ 2 }→ insert(z' - 1, 0) :|: z' - 1 >= 0
sort(z') -{ 1 }→ 0 :|: z' = 0
choose(z', z'', z1, z2) -{ 1 }→ choose(z', 1 + v + w, z1 - 1, z2 - 1) :|: v >= 0, z2 - 1 >= 0, z' >= 0, z1 - 1 >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
choose(z', z'', z1, z2) -{ 1 }→ 1 + v + insert(z', w) :|: z1 = 0, v >= 0, z2 - 1 >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 1 }→ 1 + z' + (1 + v + w) :|: v >= 0, z2 = 0, z' >= 0, z1 >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ choose(z', 1 + v + w, z', v) :|: v >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ 1 + z' + 0 :|: z'' = 0, z' >= 0
sort(z') -{ 2 }→ insert(x, insert(x', sort(y'))) :|: z' = 1 + x + (1 + x' + y'), x >= 0, x' >= 0, y' >= 0
sort(z') -{ 2 }→ insert(z' - 1, 0) :|: z' - 1 >= 0
sort(z') -{ 1 }→ 0 :|: z' = 0
insert: runtime: ?, size: O(n1) [1 + z' + z''] choose: runtime: ?, size: O(n1) [1 + z' + z''] |
choose(z', z'', z1, z2) -{ 1 }→ choose(z', 1 + v + w, z1 - 1, z2 - 1) :|: v >= 0, z2 - 1 >= 0, z' >= 0, z1 - 1 >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
choose(z', z'', z1, z2) -{ 1 }→ 1 + v + insert(z', w) :|: z1 = 0, v >= 0, z2 - 1 >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 1 }→ 1 + z' + (1 + v + w) :|: v >= 0, z2 = 0, z' >= 0, z1 >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ choose(z', 1 + v + w, z', v) :|: v >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ 1 + z' + 0 :|: z'' = 0, z' >= 0
sort(z') -{ 2 }→ insert(x, insert(x', sort(y'))) :|: z' = 1 + x + (1 + x' + y'), x >= 0, x' >= 0, y' >= 0
sort(z') -{ 2 }→ insert(z' - 1, 0) :|: z' - 1 >= 0
sort(z') -{ 1 }→ 0 :|: z' = 0
insert: runtime: O(n2) [2 + 4·z'' + 2·z''2], size: O(n1) [1 + z' + z''] choose: runtime: O(n2) [4 + 4·z'' + 2·z''2 + z2], size: O(n1) [1 + z' + z''] |
choose(z', z'', z1, z2) -{ 10 + 8·v + 4·v·w + 2·v2 + 8·w + 2·w2 + z2 }→ s1 :|: s1 >= 0, s1 <= 1 * z' + 1 * (1 + v + w) + 1, v >= 0, z2 - 1 >= 0, z' >= 0, z1 - 1 >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
choose(z', z'', z1, z2) -{ 3 + 4·w + 2·w2 }→ 1 + v + s'' :|: s'' >= 0, s'' <= 1 * z' + 1 * w + 1, z1 = 0, v >= 0, z2 - 1 >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 1 }→ 1 + z' + (1 + v + w) :|: v >= 0, z2 = 0, z' >= 0, z1 >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 11 + 9·v + 4·v·w + 2·v2 + 8·w + 2·w2 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 * (1 + v + w) + 1, v >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ 1 + z' + 0 :|: z'' = 0, z' >= 0
sort(z') -{ 4 }→ s :|: s >= 0, s <= 1 * (z' - 1) + 1 * 0 + 1, z' - 1 >= 0
sort(z') -{ 2 }→ insert(x, insert(x', sort(y'))) :|: z' = 1 + x + (1 + x' + y'), x >= 0, x' >= 0, y' >= 0
sort(z') -{ 1 }→ 0 :|: z' = 0
insert: runtime: O(n2) [2 + 4·z'' + 2·z''2], size: O(n1) [1 + z' + z''] choose: runtime: O(n2) [4 + 4·z'' + 2·z''2 + z2], size: O(n1) [1 + z' + z''] |
choose(z', z'', z1, z2) -{ 10 + 8·v + 4·v·w + 2·v2 + 8·w + 2·w2 + z2 }→ s1 :|: s1 >= 0, s1 <= 1 * z' + 1 * (1 + v + w) + 1, v >= 0, z2 - 1 >= 0, z' >= 0, z1 - 1 >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
choose(z', z'', z1, z2) -{ 3 + 4·w + 2·w2 }→ 1 + v + s'' :|: s'' >= 0, s'' <= 1 * z' + 1 * w + 1, z1 = 0, v >= 0, z2 - 1 >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 1 }→ 1 + z' + (1 + v + w) :|: v >= 0, z2 = 0, z' >= 0, z1 >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 11 + 9·v + 4·v·w + 2·v2 + 8·w + 2·w2 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 * (1 + v + w) + 1, v >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ 1 + z' + 0 :|: z'' = 0, z' >= 0
sort(z') -{ 4 }→ s :|: s >= 0, s <= 1 * (z' - 1) + 1 * 0 + 1, z' - 1 >= 0
sort(z') -{ 2 }→ insert(x, insert(x', sort(y'))) :|: z' = 1 + x + (1 + x' + y'), x >= 0, x' >= 0, y' >= 0
sort(z') -{ 1 }→ 0 :|: z' = 0
insert: runtime: O(n2) [2 + 4·z'' + 2·z''2], size: O(n1) [1 + z' + z''] choose: runtime: O(n2) [4 + 4·z'' + 2·z''2 + z2], size: O(n1) [1 + z' + z''] sort: runtime: ?, size: O(n1) [z'] |
choose(z', z'', z1, z2) -{ 10 + 8·v + 4·v·w + 2·v2 + 8·w + 2·w2 + z2 }→ s1 :|: s1 >= 0, s1 <= 1 * z' + 1 * (1 + v + w) + 1, v >= 0, z2 - 1 >= 0, z' >= 0, z1 - 1 >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
choose(z', z'', z1, z2) -{ 3 + 4·w + 2·w2 }→ 1 + v + s'' :|: s'' >= 0, s'' <= 1 * z' + 1 * w + 1, z1 = 0, v >= 0, z2 - 1 >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
choose(z', z'', z1, z2) -{ 1 }→ 1 + z' + (1 + v + w) :|: v >= 0, z2 = 0, z' >= 0, z1 >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 11 + 9·v + 4·v·w + 2·v2 + 8·w + 2·w2 }→ s' :|: s' >= 0, s' <= 1 * z' + 1 * (1 + v + w) + 1, v >= 0, z' >= 0, w >= 0, z'' = 1 + v + w
insert(z', z'') -{ 1 }→ 1 + z' + 0 :|: z'' = 0, z' >= 0
sort(z') -{ 4 }→ s :|: s >= 0, s <= 1 * (z' - 1) + 1 * 0 + 1, z' - 1 >= 0
sort(z') -{ 2 }→ insert(x, insert(x', sort(y'))) :|: z' = 1 + x + (1 + x' + y'), x >= 0, x' >= 0, y' >= 0
sort(z') -{ 1 }→ 0 :|: z' = 0
insert: runtime: O(n2) [2 + 4·z'' + 2·z''2], size: O(n1) [1 + z' + z''] choose: runtime: O(n2) [4 + 4·z'' + 2·z''2 + z2], size: O(n1) [1 + z' + z''] sort: runtime: O(n3) [5 + 12·z' + 20·z'2 + 10·z'3], size: O(n1) [z'] |